//
//  ViewController.m
//  线程保活
//
//  Created by wangjian on 2020/7/7.
//  Copyright © 2020 wangjian. All rights reserved.
//

#import "ViewController.h"
#import "WJPermanentThread.h"

@interface ViewController ()
@property(nonatomic,strong) WJPermanentThread *thread;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.thread = [[WJPermanentThread alloc] init];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.thread executeTask:^{
        NSLog(@"thread task");
    }];
}

- (IBAction)sotpThread:(id)sender {
    [self.thread stop];
}

- (void)dealloc {
    NSLog(@"%s",__func__);
//    [self.thread stop];
}

@end
